package com.party.mobile.task;
import com.party.mobile.biz.analysis.StatisticalEventFlowBizService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;

@Controller(value = "QuartzEventDataMaintenance")
public class QuartzEventDataMaintenance {
    @Autowired
    private StatisticalEventFlowBizService statisticalEventFlowBizService;
    Logger logger = LoggerFactory.getLogger(getClass());
    //每天凌晨2点执行一次
    @Scheduled(cron = "0 0 2 * * *")
    public void run(){
        //System.out.println("开始执行更新事件关系的任务");
        logger.info("开始执行更新事件关系的任务");
        long staTime = System.currentTimeMillis();
        statisticalEventFlowBizService.eventDataMaintenance();
        logger.info("执行更新事件关系的任务结束，用时："+(System.currentTimeMillis()-staTime));
        //System.out.println("执行更新事件关系的任务结束，用时："+(System.currentTimeMillis()-staTime));
    }
}
